<?php
class Admin_Model_Mailer extends Zend_Db_Table_Abstract
{
	public function __construct($config = array()) {   
        parent::__construct($config);
    }
    public function sendMail($data){
        $emailConfig = config::get('email');
        $config = array('name' => $emailConfig['host'],'port' => $emailConfig['port']);
        $transport = new Zend_Mail_Transport_Smtp('mail.danang.gov.vn', $config);
        $mail = new Zend_Mail('UTF-8');
        $mail->setBodyHtml($data['BODY']);
        $mail->setFrom($emailConfig['address'], $data['NAME_SENDER']);
        $mail->setReplyTo($emailConfig['address'], $data['NAME_SENDER']);			
        $mail->addTo($data['TO'],$data['NAME_RECEPTION']);
        $mail->setSubject($data['SUBJECT']);
        $mail->send($transport);
    }
}